/**
 * 计算不含税价格
 * @param price
 * @param tax
 * @returns {number}
 */
function computeNoTaxPrice(price, tax) {
    console.log("含税价格：" + price + ",税率:" + tax);
    if(typeof(price) == "undefined"){
        price = 0;
    }
    if(typeof(tax) == "undefined"){
        tax = 0;
    }

    if (typeof(price) == "string") {
        if (price == null || price.trim().length === 0) {
            return 0;
        }
    }
    if (typeof(tax) == "string") {
        if (tax == null || tax.trim().length === 0) {
            return 0;
        }
    }

    var noTaxPrice = price - round(parseFloat(price) / (1 + parseFloat(tax)) * parseFloat(tax),2);
    return round(noTaxPrice, 2);
}

/**
 * 获取税率，通过ajax后台获取
 * @returns {number}
 */
function getTaxRate() {
    return 0.16;
}